<!doctype html>
<html>
<head>
    <title><{$title}></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="<{$preStaticUrl}>Wap/toy/css/swiper-3.3.1.min.css" />
    <link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/toy/css/index.css?<{$resVersion}>" />
    <script src="<{$preStaticUrl}>layer_mobile/layer.js?<{$resVersion}>"></script>

    <{if $isWechat }>
    <script src=" https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
        wx.config({
                    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: "<{$wxSign.appId}>", // 必填，公众号的唯一标识
                    timestamp: "<{$wxSign.timestamp}>", // 必填，生成签名的时间戳
                    nonceStr: "<{$wxSign.nonceStr}>", // 必填，生成签名的随机串
                    signature:"<{$wxSign.signature}>",// 必填，签名，见附录1
                    jsApiList: [
                        'chooseImage',
                        'checkJsApi',
                        'chooseWXPay',
                    <{if $isWxShare}>
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                <{/if}>
        ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        <{if $isWxShare}>
        var shareData = {
            title:"<{$wxTitle}>",
            desc: "<{$wxDesc|default:$wxTitle}>",
            link: "<{$wxLink}>",
            imgUrl: "<{$wxImage}>",
            trigger: function (res) {
                // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
                // alert('用户点击发送给朋友');
            },
            success: function (res) {
                var objType = "<{$wxObjType}>";
                var objID = "<{$wxObjID}>";
                var param = {objType:objType,objID:objID};
                $.getJSON("<{U('User/weixinDayFirstShare')}>",param,function(result){
                    console.log(result);
                    if(result.status == 0 ){
                        tip(result.tip);
                    } else{
                    }
                })
            },
            cancel: function (res) {
            },
            fail: function (res) {
                tip('分享失败');
            }
        };
        <{/if}>

        var canpay=false;
        wx.ready(function () {




            <{if $isWxShare}>
            wx.onMenuShareAppMessage(shareData);
            wx.onMenuShareTimeline(shareData);
            <{/if}>
            <{if $hasUnreceive eq 1}>
            wx.addCard({
                cardList: [{
                    cardId:  '<{$wxCardId}>',
                    cardExt: '<{$cardExt}>'
                }], // 需要添加的卡券列表
                success: function (res) {
                },
                cancel: function (res) {
                }
            });
            <{/if}>
            canpay=true;



        });
    </script>
    <{/if}>

